using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class incentive_scoreMap : EntityTypeConfiguration<incentive_score>
    {
        public incentive_scoreMap()
        {
            // Primary Key
            this.HasKey(t => t.user_id);

            // Properties
            this.Property(t => t.user_id)
                .IsRequired()
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("incentive_score");
            this.Property(t => t.user_id).HasColumnName("user_id");
            this.Property(t => t.incentive_score1).HasColumnName("incentive_score");
            this.Property(t => t.available_score).HasColumnName("available_score");
            this.Property(t => t.lock_score).HasColumnName("lock_score");

            // Relationships
            this.HasRequired(t => t.user)
                .WithOptional(t => t.incentive_score);

        }
    }
}
